<template>
  <div class="list">
    <div class="box">
      <div>
        <el-tag class="r5" type="success">{{ detail.status }}</el-tag>
      </div>
      <div class="company-name">
        {{ detail.company_name }}
      </div>
      <div class="company-info">
        <div class="company-info-item">
          <span class="title">所在地区</span>：{{ detail.region }}
        </div>
        <div class="company-info-item">
          <span class="title">注册日期</span>：{{ detail.start_date }}
        </div>
        <div class="company-info-item">
          <span class="title">通讯地址</span>：{{ detail.address }}
        </div>
        <div class="company-info-item">
          <span class="title">工商注册号</span>：{{ detail.no }}
        </div>
        <div class="company-info-item">
          <span class="title">注册资本</span>：{{ detail.regist_capi }}
        </div>
      </div>
    </div>
    <div class="list-view box">
      <el-tabs type="border-card" class="border-card-customize">
        <el-tab-pane label="工商信息">
          <industry :detail="detail" :gudongxinxi="gudongxinxi" :biangenglishi="biangenglishi" />
        </el-tab-pane>
        <el-tab-pane label="负面信息">
          <negative 
            :beizhixing="beizhixing"
            :shixinbeizhixing="shixinbeizhixing"
            :caipanwenshu="caipanwenshu"
            :kaiting="kaiting"
            :guquanchuzhi="guquanchuzhi"
            :jingyingyichang="jingyingyichang"
            :qianshuigonggao="qianshuigonggao"
          />
        </el-tab-pane>
        <el-tab-pane label="经营信息">
          <manage
            :xinwenyuqing="xinwenyuqing"
            :zhaopin="zhaopin"
          />
        </el-tab-pane>
        <el-tab-pane label="资产信息">
          <assets
            :zhuanli="zhuanli"
          />
        </el-tab-pane>
        <!-- <el-tab-pane label="营销信息">
          <marketing />
        </el-tab-pane>
        <el-tab-pane label="关系链条">
          <nexus />
        </el-tab-pane> -->
      </el-tabs>
    </div>
  </div>
</template>

<script>
// import Breadcrumb from "@/components/breadcrumb/index"
import Assets from "./components/Assets"
import Industry from "./components/Industry"
import Manage from "./components/Manage"
import Marketing from "./components/Marketing"
import Negative from "./components/Negative"
import Nexus from "./components/Nexus"
import { 
  show,
  gudongxinxi,
  biangenglishi,
  beizhixing,
  shixinbeizhixing,
  caipanwenshu,
  kaiting,
  guquanchuzhi,
  qianshuigonggao,
  jingyingyichang,
  xinwenyuqing,
  zhaopin,
  zhuanli
} from "@/api/merchants/merchants"

export default {
  components: {
    // Breadcrumb
    Assets, // 资产信息
    Industry, // 工商信息
    Manage, // 经营信息
    Marketing, // 营销信息
    Negative, // 负面信息
    Nexus // 关系链条
  },
  data() {
    return {
      detail: [],
      gudongxinxi: [],
      biangenglishi: [],
      beizhixing: [],
      shixinbeizhixing: [],
      caipanwenshu: [],
      kaiting: [],
      guquanchuzhi: [],
      qianshuigonggao: [],
      jingyingyichang: [],
      xinwenyuqing: [],
      zhaopin: [],
      zhuanli: []
    }
  },
  created() {
    this.getDetail(this.$route.params.id)
    this.getgudongxinxi(this.$route.params.id)
    this.getbiangenglishi(this.$route.params.id)
    this.getbeizhixing(this.$route.params.id)
    this.getshixinbeizhixing(this.$route.params.id)
    this.getcaipanwenshu(this.$route.params.id)
    this.getkaiting(this.$route.params.id)
    this.getguquanchuzhi(this.$route.params.id)
    this.getqianshuigonggao(this.$route.params.id)
    this.getjingyingyichang(this.$route.params.id)
    this.getxinwenyuqing(this.$route.params.id)
    this.getzhaopin(this.$route.params.id)
    this.getzhuanli(this.$route.params.id)
  },
  methods: {
    // 工商详情
    getDetail(id) {
      show({ company_id: id }, response => {
        this.detail = response.data
      })
    },
    // 股东信息
    getgudongxinxi(id) {
      gudongxinxi({ company_id: id }, response => {
        this.gudongxinxi = response.data
      })
    },
    // 变更历史
    getbiangenglishi(id) {
      biangenglishi({ company_id: id }, response => {
        this.biangenglishi = response.data
      })
    },
    // 被执行人信息
    getbeizhixing(id) {
      beizhixing({ company_id: id }, response => {
        this.beizhixing = response.data
      })
    },
    // 失信人被执行信息
    getshixinbeizhixing(id) {
      shixinbeizhixing({ company_id: id }, response => {
        this.shixinbeizhixing = response.data
      })
    },
    // 裁判文书
    getcaipanwenshu(id) {
      caipanwenshu({ company_id: id }, response => {
        this.caipanwenshu = response.data
      })
    },
    // 开庭公告
    getkaiting(id) {
      kaiting({ company_id: id }, response => {
        this.kaiting = response.data
      })
    },
    // 股权出资
    getguquanchuzhi(id) {
      guquanchuzhi({ company_id: id }, response => {
        this.guquanchuzhi = response.data
      })
    },
    // 经营异常
    getjingyingyichang(id) {
      jingyingyichang({ company_id: id }, response => {
        this.jingyingyichang = response.data
      })
    },
    // 欠税公告
    getqianshuigonggao(id) {
      qianshuigonggao({ company_id: id }, response => {
        this.qianshuigonggao = response.data
      })
    },
    // 新闻舆情
    getxinwenyuqing(id) {
      xinwenyuqing({ company_id: id }, response => {
        this.xinwenyuqing = response.data
      })
    },
    // 招聘信息
    getzhaopin(id) {
      zhaopin({ company_id: id }, response => {
        this.zhaopin = response.data
      })
    },
    // 专利信息
    getzhuanli(id) {
      zhuanli({ company_id: id }, response => {
        this.zhuanli = response.data
      })
    }
  }
}
</script>

<style lang="scss" scoped>
@import "@/styles/merchants/detail";
</style>
